package com.da.springtest.ioc.create;

/**
 * @author chenlida
 * @date 2020/6/13 21:46
 * @description
 */
public class UserStaticFactory {

    /**
     * 静态无参方法创建UserModel
     */
    public static UserModel buildUser1() {
        System.out.println(UserStaticFactory.class + ".buildUser1()");
        UserModel userModel = new UserModel();
        userModel.setName("通过工厂静态无参方法创建UerModel实例对象");
        return userModel;
    }

    /**
     * 静态有参方法创建UserModel
     */
    public static UserModel buildUser2(String name, int age) {
        System.out.println(UserStaticFactory.class + ".buildUser2()");
        return new UserModel(name, age);
    }

}